/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tanks.items;
import com.sun.lwuit.*;
import tanks.BlockType;
import tanks.Cell;
import tanks.Game;
import tanks.Graph;
import tanks.Tank;
/**
 *
 * @author Александр
 */
 public abstract class Item
    {
        protected Image Gr;
        protected Game game = Game.Instance();
        protected abstract void Pickup(Tank t);
        public Cell C;
        public void Draw(Image canvas)
        {
            if (C.currTank != null)
            {
                Pickup(C.currTank);
            }

            if (C.Block == BlockType.Empty)
            {
                Graphics gr = canvas.getGraphics();
                gr.drawImage(Gr, C.X() * Graph.CellSize(), C.Y() * Graph.CellSize(),Graph.CellSize(),Graph.CellSize());
            }
        }
    }
